@echo off
REM 测试纵向图像转场效果的完整命令
REM 这个脚本会先对图像进行适当的缩放和填充，然后再应用转场效果

set INPUT1=E:\codes\createVideo\temp\glenworld\1\8\red\red_with_background.jpg
set INPUT2=E:\codes\createVideo\temp\glenworld\1\8\blue\blue_with_background.jpg
set TRANSITION_SHADER=../transitions/InvertedPageCurl_Final.glsl
set OUTPUT=transition_test.mp4

REM 使用scale和pad过滤器确保图像正确处理为1080x1920
..\bin\ffmpeg.exe -y ^
-loop 1 -i "%INPUT1%" -loop 1 -i "%INPUT2%" ^
-filter_complex "[0:v]scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:(ow-iw)/2:(oh-ih)/2,setsar=1,trim=duration=2,setpts=PTS-STARTPTS[v0];[1:v]scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:(ow-iw)/2:(oh-ih)/2,setsar=1,trim=duration=2,setpts=PTS-STARTPTS[v1];[v0][v1]gltransition=source=%TRANSITION_SHADER%:duration=1" ^
-c:v libx264 -t 2 -pix_fmt yuv420p "%OUTPUT%"

echo 测试完成，输出文件：%OUTPUT%